<table class="table table-hover">
	<div class="toolbar">
		<a class="btn btn-primary add-row-feature-detail" name="btnSave" data-id='<?php echo $this->data ['id']?>'><i class="icon-plus"></i> Thêm mới</a> <a class="btn btn-bricky delete-all-category"><i class="icon-trash"></i> Xoá tất cả</a>
	</div>
	<thead>
		<tr>
			<th width='30px;'><input type="checkbox" id="check-all" class="checkall"></th>
			<th class='sort' width='250px;'>Tên thuộc tính</th>     
                <?php if (ENGLISH == 1) { ?>
                    <th class='sort' width='250px;'>Tên thuộc tính (Tiếng anh)</th>     
                <?php } ?>   
	                <th class='sort' data-id="int" width='150px;'>Giá trị thuộc tính</th>
			<th class='sort' data-id="int" width='80px;'>Thứ tự</th>
			<th width='50px;'>Tình trạng</th>
			<th width='50px;'>Đăng bởi</th>
			<th width='80px;'>Ngày đăng</th>
			<th width='50px;'>Sửa bởi</th>
			<th width='80px;'>Ngày sửa</th>
			<th width='50px;'>Thao tác</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<th><input type='hidden' class='input-filter' data-name='FeatureId' id='ftFeatureId' value='<?php echo $this->data ['id'];?>'></th>
			<th><input type='text' class='input-filter' data-name='titleVi' id='ftTitleVi' placeholder='Nhập tên thuộc tính ...'></th>     
                <?php if (ENGLISH == 1) { ?>
                    <th><input type='text' class='input-filter' data-name='titleEn' id='ftTitleEn' placeholder='Nhập tên thuộc tính ...'></th>     
                <?php } ?>   
                <th></th>
			<th></th>
			<th><select class='input-filter' data-name='status' id='flStatus'>
					<option value='1'>Hiện</option>
					<option value='0'>Ẩn</option>
			</select></th>
			<th></th>
			<th><input type="text" class='input-filter' data-name='createFrom' id='ftCreateFrom' style='height: 15px; margin: 2px 0' /><br /> <input type="text" class='input-filter' data-name='createTo' id='ftCreateTo' style='height: 15px;' /></th>
			<th></th>
			<th><input type="text" class='input-filter' data-name='modifiedFrom' id='ftModifiedFrom' style='height: 15px; margin: 2px 0' /><br /> <input type="text" class='input-filter' data-name='modifiedTo' id='ftModifiedTo' style='height: 15px;' /></th>
		</tr>                                
        <?php echo $this->partialLoop("_partials/feature-detail/list.phtml", $this->featureDetail); ?> 
        </tbody>
</table>
<!-- 
<form method="post" name="form1" id='frmSanPham'>
    <div class="toolbar-warraper">
        <div class="toolbar-inner">
            <div class="module-title">Danh sách thuộc tính</div>
            <div class="toolbar-command">
                <a class="tb-button icon-20-addnew" href="<?php echo $this->url(array('controller' => $this->controllerName, 'action' => 'add')) ?>"><span></span>Thêm mới</a>
                <a class="tb-button icon-20-deleteall delete" ><span></span>Xóa chọn</a>
                <a class="tb-button icon-20-help" href="<?php echo $this->url(array('controller' => 'index')); ?>"><span></span>Trang chủ</a>
            </div>
            <div style="clear: both;">
            </div>
        </div>
    </div>

    <div>
        <table class="tblSkin" cellspacing="0" rules="all" border="1" id="tb_sort" style="width:100%;border-collapse:collapse;">
            <tr class="tblSkinHeader">    
                <th width='30px;'><input type="checkbox" id="check-all" class="checkall"></th>     
                <th class='sort' width='300px;'>Tên danh mục</th>     
                <?php if (ENGLISH == 1) { ?>
                    <th class='sort' width='300px;'>Tên danh mục (Tiếng anh)</th>     
                <?php } ?>      
                <th class='sort' width='200px;'>Danh mục sản phẩm</th>
                <th class='sort' data-id="int" width='150px;'>Đơn giá</th>
                <th class='sort' data-id="int" width='80px;'>Thứ tự</th>                                
                <th width='50px;'>Tình trạng</th>
                <th width='50px;'>Thao tác</th>
            </tr>
            <?php
				if ($this->featureDetail != NULL) {
					echo $this->partialLoop ( "_partials/{$this->controllerName}/list.phtml", $this->featureDetail );
				} else {
					echo '<tr class = "tblSkinRow"><td colspan = "15"><div class = "empty-data">Không tìm thấy dữ liệu!</div></td></tr>';
				}
				?>
        </table>  

    </div>
</form>
<script type="text/javascript" language="javascript">
    $(document).ready(function() {
        // update Weight
        $('.txtWeight').change(function() {
            var id = $(this).attr('data-id');
            var weight = $(this).val();

            $.ajax({
                type: "POST",
                url: "ajax-edit-feature-detail/",
                data: ({field: 'weight', value: order, id: id}),
                beforeSend: function() {
                    $("#updateProgress").show();
                },
                success: function(string) {
                    setTimeout(function() {
                        $("#updateProgress").hide();
                    }, 800);
                }
            });
        });
        
        /*
         * update price  
         */
        $('.txtPrice').change(function() {
            var id = $(this).attr('data-id');
            var value = $(this).val();

            $.ajax({
                type: "POST",
                url: "ajax-edit-feature-detail/",
                data: ({field: 'price', value: value, id: id}),
                beforeSend: function() {
                    $("#updateProgress").show();
                },
                success: function(string) {
                    setTimeout(function() {
                        $("#updateProgress").hide();
                    }, 800);
                }
            });
        });
        
        $('.div-status').click(function() {
            var id = $(this).find('.status').attr('data-id');
            var value = $(this).find('.status').attr('data-value');
            var thiss = $(this);

            $.ajax({
                type: "POST",
                url: "ajax-edit-feature-detail/",
                data: ({field: 'status', value: value, id: id}),
                beforeSend: function() {
                    $("#updateProgress").show();
                },
                success: function(data) {
                    var reponse = jQuery.parseJSON(data);
                    var html = '';

                    setTimeout(function() {
                        $("#updateProgress").hide();
                    }, 800);

                    if (reponse.result == 1) {
                        if (reponse.value == 1) {
                            html += '<img data-id="' + id + '" data-value="0" class="status" src="/public/templates/admin/images/tick.png"/>';
                        } else {
                            html += '<img data-id="' + id + '" data-value="1" class="status" src="/public/templates/admin/images/disabled.png"/>';
                        }
                    }

                    thiss.html(html);
                }
            });
        });


        $('.delete-category').click(function() {
            var id = $(this).attr('data-id');

            if (confirm('Bạn có muốn xóa danh mục này?')) {
                $.ajax({
                    type: "POST",
                    url: "ajax-delete-feature-detail/",
                    data: ({id: id}),
                    success: function(data) {
                        var reponse = jQuery.parseJSON(data);

                        if (reponse.result == 1) {
                            $('#item-' + id).slideUp();
                            $('#item-' + id).empty();
                        } else {
                            $('body').append(reponse.value);
                        }
                    }
                });
            }
        });
    });
</script>
 -->